package messageprocessors.clients;


public class Station {
public String stationName;
public String understation;
public String stationDate;
public String stationuserid;

public Station(){
	this.stationName="";
	this.understation="";
	this.stationDate="";
	this.stationuserid="";
}

public Station(String stationName,String understation, String stationDate, String stationuserid){
	this.stationName=stationName;
	this.understation=understation;
	this.stationDate=stationDate;
	this.stationuserid=stationuserid;
}


public void setStation(String stationName,String understation, String stationDate, String stationuserid){
	setStationName(stationName);
	setUnderstation(understation);
	setStationDate(stationDate);
	setStationuserid(stationuserid);
}
public Station creatStation(String station){
	Station stationex=new Station();
	station.replace("\n", "");
	String[]stationzeichen=station.split("\t");
	int i=0;
	while (i<=stationzeichen.length){
		int x=1;
		if (x==1){
			stationex.setStationName(stationzeichen[i]);
		}else if(x==2){
			stationex.setUnderstation(stationzeichen[i]);
		}else if (x==3){
			stationex.setStationDate(stationzeichen[i]);
		}else if (x==4){
			stationex.setStationuserid(stationzeichen[i]);
		}
		i++;
	}
	return stationex;
}
/**
 * @return the stationName
 */
public String getStationName() {
	return stationName;
}
/**
 * @param stationName the stationName to set
 */
public void setStationName(String stationName) {
	this.stationName += stationName;
}
/**
 * @return the understation
 */
public String getUnderstation() {
	return understation;
}
/**
 * @param understation the understation to set
 */
public void setUnderstation(String understation) {
	this.understation += understation;
}
/**
 * @return the stationDate
 */
public String getStationDate() {
	return stationDate;
}
/**
 * @param stationDate the stationDate to set
 */
public void setStationDate(String stationDate) {
	this.stationDate += stationDate;
}
/**
 * @return the stationuserid
 */
public String getStationuserid() {
	return stationuserid;
}
/**
 * @param stationuserid the stationuserid to set
 */
public void setStationuserid(String stationuserid) {
	this.stationuserid += stationuserid;
}

public String toString(){
	String ausgabe="";
	ausgabe+=this.getStationName()+"\t"+
			 this.getUnderstation()+"\t"+
			 this.getStationDate()+"\t"+
			 this.getStationuserid()+"\t\n";
	return ausgabe;
			 
}

}
